<template>
	<view class="bar">
		<view class="bar-item" :class="current === 0 ? 'active' : ''" @click="filterNav(0)">最近回复</view>
		<view class="bar-item" :class="current === 1 ? 'active' : ''" @click="filterNav(1)">最近主题</view>
	</view>
</template>

<script>
	export default {
		data (){
			return {
				current: 0
			}
		},
		methods: {
			filterNav (cur){
				this.current = cur;
				this.$EventBus.$emit('author_tabBar', this.current)
			}
		}
	}
</script>

<style lang="scss">
	.bar{
		display: flex;
		justify-content: space-between;
		.bar-item{
			flex: 1;
			text-align: center;
			line-height: 40px;
			border-bottom: 1px solid #F2F2F2;
			&.active{
				color: $baseColorActive;
				border-bottom: 2px solid $baseColorActive;
			}
			&:active{
				color: $baseColorActive;
			}
		}
	}
</style>
